package demoMod.nanaki.relics;

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.actions.common.GainEnergyAction;
import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import demoMod.nanaki.NanakiMod;
import demoMod.nanaki.interfaces.ExitStropheHook;

public class OldHeadwear extends CustomRelic implements ExitStropheHook {
    public static final String ID = NanakiMod.makeID("OldHeadwear");
    public static final Texture IMG = new Texture(NanakiMod.getResourcePath("relics/OldHeadwear.png"));
    public static final Texture IMG_OUTLINE = new Texture(NanakiMod.getResourcePath("relics/OldHeadwear_outLine.png"));

    private boolean activated = false;

    public OldHeadwear() {
        super(ID, IMG, IMG_OUTLINE, RelicTier.BOSS, LandingSound.FLAT);
    }

    @Override
    public String getUpdatedDescription() {
        return DESCRIPTIONS[0];
    }

    @Override
    public void atTurnStart() {
        this.activated = true;
    }

    @Override
    public void onPlayerEndTurn() {
        this.activated = false;
    }

    @Override
    public void onExitStrophe() {
        if (activated) {
            this.flash();
            addToBot(new RelicAboveCreatureAction(AbstractDungeon.player, this));
            addToBot(new GainEnergyAction(1));
            this.activated = false;
        }
    }
}
